#include<bits/stdc++.h>
using namespace std;
#define int long long

int cnt[30];
int cnt_max[30];

signed main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());

	for (int i = 1; i < s.size() - 1; i++) {
		cnt[s[i] - 'A']++;
	}

	for (int i = 0; i < s.size(); i++) {
		cnt_max[s[i] - 'A']++;
	}

	int ans = 0;
	for (int i = 0; i < 26; i++) {
		ans += (100 - 4 * i) * cnt[i];
	}
	cout << fixed << setprecision(2) << (1.0 * ans) / ((int)s.size() - 2) << endl;

	int mx = *max_element(cnt_max, cnt_max + 26);
	for (int i = 25; i >= 0; i--) {
		if (cnt_max[i] == mx) {
			cout << 100 - i * 4;
			break;
		}
	}
	return 0;
}
